# Contributor: Rasmus Thomsen <oss@cogitri.dev>
# Maintainer: Rasmus Thomsen <oss@cogitri.dev>
pkgname=gnome-shell
pkgver=3.36.4
pkgrel=0
pkgdesc="GNOME shell"
url="https://wiki.gnome.org/Projects/GnomeShell"
arch="all !s390x !ppc64le !mips !mips64"
license="GPL-2.0-or-later"
depends="accountsservice
	caribou
	elogind
	gsettings-desktop-schemas
	upower
	ibus
	librsvg
	network-manager-applet
	gnome-bluetooth
	gnome-control-center
	font-adobe-source-code-pro
	ttf-cantarell
	adwaita-icon-theme
	gnome-themes-standard
	unzip
	"
makedepends="gnome-desktop-dev>=3.35.91
	libxml2-dev
	libcanberra-dev
	gobject-introspection-dev
	startup-notification-dev
	libsoup-dev
	polkit-dev
	gcr-dev
	gjs-dev>=1.64.0
	mutter-dev>=3.36.0
	libcroco-dev
	pulseaudio-dev
	evolution-data-server-dev evolution-dev
	python3
	meson
	libxml2-utils
	ibus-dev
	sassc
	networkmanager-dev
	libnma-dev
	gnome-control-center-dev
	py3-setuptools
	gnome-bluetooth-dev
	gstreamer-dev
	gnome-autoar-dev
	asciidoc
	libcap
	elogind-dev
	"
checkdepends="
	xvfb-run
	mesa-dri-swrast
	"
	# gdm is also needed but introduces circular dep
subpackages="$pkgname-lang $pkgname-doc $pkgname-dbg"
source="https://download.gnome.org/sources/gnome-shell/${pkgver%.*}/gnome-shell-$pkgver.tar.xz
	disable-telepathy-integration.patch"
options="!check" # Tests have circular dependency 'gnome-shell <-> gdm'

build() {
	meson \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--localstatedir=/var \
		--buildtype=plain \
		-Dsystemd=true \
		. output
	ninja -C output
}

check() {
	xvfb-run ninja -C output test
}

package() {
	DESTDIR="$pkgdir" ninja -C output install
	#allow realtime scheduling
	setcap cap_sys_nice+ep "$pkgdir"/usr/bin/gnome-shell
}

sha512sums="879b1590d516e7e9e1ad066c870023d59cbaaca13e1e77d8b14de302574b3138451c4b8ab0ba1b43aec3e6e03bd147304e8e0e995359b181522a790afc97d450  gnome-shell-3.36.4.tar.xz
2ca70115fab957fdf276b7f0772786e1afd56b0b22bcfd92f5b5f1d29676dc97c19cfb079434d0dbf7b459f1d133dbd8d1faa0d88f7b94846040a23856f951f8  disable-telepathy-integration.patch"
